summaryrefslogtreecommitdiff
path: root/src/pages/sitemap/products/[id].xml.js
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-04-27 17:10:16 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-04-27 17:10:16 +0700
commit563de6cd65b2ff81fc26a5f92aef55c2f54219c2 (patch)
tree3373477adc7ee1b06ee2541df754503af278e36e /src/pages/sitemap/products/[id].xml.js
parent5d8ad078bdc735e708654e278b226868dc3bc403 (diff)
sitemap product detail
Diffstat (limited to 'src/pages/sitemap/products/[id].xml.js')
-rw-r--r--src/pages/sitemap/products/[id].xml.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/pages/sitemap/products/[id].xml.js b/src/pages/sitemap/products/[id].xml.js
deleted file mode 100644
index 98c2bf40..00000000
--- a/src/pages/sitemap/products/[id].xml.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import productSearchApi from '@/lib/product/api/productSearchApi'
-import { create } from 'xmlbuilder'
-import _ from 'lodash-contrib'
-import { createSlug } from '@/core/utils/slug'
-
-export async function getServerSideProps({ res }) {
- const baseUrl = process.env.SELF_HOST + '/shop/product'
- const limit = 2500
- const query = { limit }
- const products = await productSearchApi({ query: _.toQuery(query) })
- console.log(products)
- // const sitemap = create('urlset', { encoding: 'UTF-8' })
-
- // const date = new Date()
- // pages.forEach((page) => {
- // const url = sitemap.ele('url')
- // url.ele('loc', createSlug(baseUrl, '', ''))
- // url.ele('lastmod', date.toISOString().slice(0, 10))
- // url.ele('changefreq', 'weekly')
- // url.ele('priority', '0.8')
- // })
-
- // res.setHeader('Content-Type', 'text/xml')
- // res.write(sitemap.end())
- // res.end()
-
- return { props: {} }
-}
-
-export default function SitemapProducts() {
- return <></>
-}